# IPMB 协议库构建配置

ipmb_sources = [
    'ipmb.cpp',
]

# 创建 IPMB 协议库
libipmb = shared_library(
    'dev_ipmb',
    ipmb_sources,
    include_directories: dev_inc_dir,
    dependencies: libmcpp_deps,
    install: true,
    install_dir: lib_dir,
)

# 创建依赖项
ipmb_dep = declare_dependency(link_with: libipmb)

# 安装头文件
install_headers([
    'ipmb.h',
], install_dir: install_inc_dir / 'ipmb')

if build_tests and meson_build
  custom_target(
    'copy_dev_ipmb',
    output: 'copy_dev_ipmb',
    command: ['cp', libipmb.full_path(), lib_dir],
    depends: libipmb,
    build_by_default: true,
  )
endif
